Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <base id="myBase" > </head> <body> <p>Click the button to set the value of the target attribute of ALL links on a page to "_blank".</p> <p><a href="../index.html">W3Schools</a></p> <p><a href="../index.html">W3Schools</a></p> <p><b>Note:</b> Try the links before and after you have clicked the button!</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myBase").target = "_blank"; document.getElementById("demo").innerHTML = "The value of the target attribute was set."; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_base_target2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:31:20 GMT --> </html>
Result:
Try it Yourself - © w3schools.com